package com.dkm.ec.activity.repository;

import com.dkm.biz.repository.IRepository;
import com.dkm.ec.activity.domain.TScheduleLock;
import com.dkm.ec.activity.persistence.entity.TScheduleLockPo;

/**
 * 任务调度锁的repository
 * Created by fanjinyuan on 2017/8/18.
 */
public interface TScheduleLockRepository extends IRepository<String, TScheduleLockPo, TScheduleLock> {

    /**
     * 通过key获取一条lock实体
     * @param key
     * @return
     */
    TScheduleLockPo get(String key);

    /**
     * 通过key获取锁
     * @param key
     * @return
     */
    Boolean getLock(String key);

    /**
     * 通过key释放
     * @param key
     */
    void unLock(String key);

}
